#include <iostream>
#include <string>

using namespace std;

string *ps1 = new string;   //默认初始化为空string
string *ps2 = new string(); //值初始化为空string
int *pi1 = new int;         //默认初始化；*pi1的值未定义
int *pi2 = new int();       //值初始化为0；*pi2为0

class X
{
    int a;

public:
    void ShowX()
    {
        cout << a;
    }
    X() = default;
};

void test()
{
    X xx;
    xx.ShowX(); //对象xx中的a成员的值被默认初始化，由于a是在块作用域内定义的,所以此处输出的值未定义

    int i;
    cout << &i << endl;
    // i = 2;

    int j = 3;
    int k;
    // k = 9;
    int kk;
    kk = 7;
}

struct part

{
    // typedef double DD;
    using DD = double;

    DD fun(DD I);
};

part::DD part::fun(DD i) //定义
{
    cout << "DD fun!" << endl;
    return 0.f;
}

void test01()
{
    part mypart;
    mypart.fun(1.f);
}

int main()
{
    test();
    test01();

    return 0;
}